1. Field of the Invention
The present invention generally relates to processing of database queries and, more particularly, to filtering of query results based on limitations associated with an entity being queried.
2. Description of the Related Art
Databases are computerized information storage and retrieval systems. A relational database management system is a computer database management system (DBMS) that uses relational techniques for storing and retrieving data. The most prevalent type of database is the relational database, a tabular database in which data is defined so that it can be reorganized and accessed in a number of different ways. A distributed database is one that can be dispersed or replicated among different points in a network. An object-oriented programming database is one that is congruent with the data defined in object classes and subclasses.
Regardless of the particular architecture, a DBMS can be structured to support a variety of different types of operations. Such operations can be configured to retrieve, add, modify and delete information being stored and managed by the DBMS. Standard database access methods support these operations using high-level query languages, such as the Structured Query Language (SQL). The term “query” denominates a set of commands that cause execution of operations for processing data from a stored database. For instance, SQL supports four types of query operations, i.e., SELECT, INSERT, UPDATE and DELETE. A SELECT operation retrieves data from a database, an INSERT operation adds new data to a database, an UPDATE operation modifies data in a database and a DELETE operation removes data from a database.
Any requesting entity, including applications, operating systems and users, can issue queries against data in a database. Queries may be predefined (i.e., hard coded as part of an application) or may be generated in response to input (e.g., user input). Upon execution of a query against a database, a result set is returned to the requesting entity.
One of the difficulties for users in running queries is to discern relevant information from result sets. In particular, the users often attempt to understand the result set from the perspective of “entities”, that is users often associate query results with a logical entity related to the result set. For example, in a medical data environment the focus of research is often on patients, a type of entity. Most of the relevant data in a medical data environment is in the form of continuous ranges of values, meaning that patients can have a multiplicity of tests with different values for each test. As a result, a given result set may contain a multiplicity of data records for each patient.
For instance, assume a researcher who performs a statistical analysis in a hospital to determine information about patients on which one or more hemoglobin tests were performed within a time when the patients were taking a particular drug. Furthermore, assume the researcher wants to view a display of only the top three hemoglobin test values for each patient. Doing so may assist the researcher in identifying patients with abnormally high hemoglobin levels. By way of example, assume that such abnormally high hemoglobin values can be used to identify whether further diagnostic tests on concerned patients are required.
Assume now that the researcher issues a single query against one or more underlying databases to determine the required information about the patients. Assume further that the query is executed against the underlying database(s), whereby a single result set is obtained having a multiplicity of data records for each patient. In order to view a display of only the top three hemoglobin test values for each patient, the researcher needs to identify manually the relevant data record(s) from the obtained result set. However, the process of manually identifying the relevant data records from the result set is a tedious process which is error prone and time consuming, particularly where the result set is voluminous.
Therefore, there is a need for an efficient technique for restricting a number of data records returned in a result set for a query, in particular, where a query may focus on some data related to instances of an entity being queried.